<template>
	<view class="template">
		<view class="checkup-info">
			<scroll-view scroll-x='true' class="head-tab">
				<view class="tab-view" @click="switch_tab(index)" v-for="(item, index) in tab_arr" :key="index" :class="[index == tab_act ? 'tab-view-act' : '']">{{ item }}</view>
			</scroll-view>
			<view class="checkup-container">
				<view class="body-container">
					<view class="body-text-info">
						<view class="id-info">
							<view class="id-info-view id-info-view-first">
								姓名：
								<view class="bold-font">{{userData.realname}}</view>
							</view>
							<view class="id-info-view">
								性别：
								<view class="bold-font">{{userData.gender_text}}</view>
							</view>
						</view>
						<view class="body-info">
							<view class="body-info-head">
								<view class="body-info-l"><image src="../../../static/images/jewel/health/body-img.png" mode=""></image></view>
								<view class="body-info-c"><view class="body-height">170cm</view></view>
								<view class="body-info-r">
									<view class="body-param-parent">
										<view class="body-param">105.60</view>
										<view class="body-type">蛋白质生产功能</view>
									</view>
									<view class="body-param-parent">
										<view class="body-param">0.391</view>
										<view class="body-type">能量生产功能</view>
									</view>
									<view class="body-param-parent">
										<view class="body-param">0.041</view>
										<view class="body-type">解毒功能</view>
									</view>
									<view class="body-param-parent">
										<view class="body-param">0.307</view>
										<view class="body-type">胆汁分泌功能</view>
									</view>
									<view class="body-param-parent">
										<view class="body-param">0.767</view>
										<view class="body-type">肝内脂肪含量</view>
									</view>
								</view>
							</view>
							<view class="body-info-foot">
								<image src="../../../static/images/jewel/health/body-weight.png" mode=""></image>
								<view class="body-weight">60kg</view>
							</view>
						</view>
					</view>
					<view class="body-range-info">
						<view class="range-container">
							<view class="range-type">蛋白质代谢功能</view>
							<view class="range-text-container">
								<view class="range-text-container-child">
									<view class="range-text">正常范围 116.34—220.621</view>
									<image src="../../../static/images/jewel/health/body-range-1.png" mode=""></image>
								</view>
							</view>
						</view>
						<view class="range-container">
							<view class="range-type">能量生产功能</view>
							<view class="range-text-container">
								<view class="range-text-container-child">
									<view class="range-text">正常范围0.713—0.992</view>
									<image src="../../../static/images/jewel/health/body-range-2.png" mode=""></image>
								</view>
							</view>
						</view>

						<view class="range-container">
							<view class="range-type">解毒功能</view>
							<view class="range-text-container">
								<view class="range-text-container-child">
									<view class="range-text">正常范围0.202—0.991</view>
									<image src="../../../static/images/jewel/health/body-range-3.png" mode=""></image>
								</view>
							</view>
						</view>

						<view class="range-container">
							<view class="range-type">胆汁分泌功能</view>
							<view class="range-text-container">
								<view class="range-text-container-child">
									<view class="range-text">正常范围0.432—0.826</view>
									<image src="../../../static/images/jewel/health/body-range-4.png" mode=""></image>
								</view>
							</view>
						</view>

						<view class="range-container">
							<view class="range-type">肝内脂肪含量</view>
							<view class="range-text-container">
								<view class="range-text-container-child">
									<view class="range-text">正常范围0.097—0.419</view>
									<image src="../../../static/images/jewel/health/body-range-5.png" mode=""></image>
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="standard-container">
			<view class="standard-content">
				<view class="reference-standard-text">参考标准：</view>
				<view class="">
					<view class="standard-reminder-content">
						<view class="reminder-row">
							<view class="reminder-row-l">
								<view class="reminder-color reminder-green"></view>
								<view class="reminder-degree">正常(—)</view>
							</view>
							<view class="reminder-row-r">
								<view class="reminder-color reminder-yellow"></view>
								<view class="reminder-degree">轻度异常(+)</view>
							</view>
						</view>
						<view class="reminder-row">
							<view class="reminder-row-l">
								<view class="reminder-color reminder-orange"></view>
								<view class="reminder-degree">中度异常(++)</view>
							</view>
							<view class="reminder-row-r">
								<view class="reminder-color reminder-red"></view>
								<view class="reminder-degree">重度异常(+++)</view>
							</view>
						</view>
					</view>
					<view class="standrad-number-container">
						<view class="standrad-number-content">
							<view class="standard-title">蛋白质代谢功能</view>
							<view class="standard-number">
								<view class="standard-number-h">
									<view class="standard-number-l">116.34—220.621(—)</view>
									<view class="standard-number-r">116.34—220.621(—)</view>
								</view>
								<view class="standard-number-h">
									<view class="standard-number-l">60.23—90.36(++)</view>
									<view class="standard-number-r">
										<!-- <text decode='true'> &lt; </text> -->
										60.23(+++)
									</view>
								</view>
							</view>
						</view>

						<view class="standrad-number-content">
							<view class="standard-title">能量生产功能</view>
							<view class="standard-number">
								<view class="standard-number-h">
									<view class="standard-number-l">0.713—0.992(—)</view>
									<view class="standard-number-r">0.475—0.713(+)</view>
								</view>
								<view class="standard-number-h">
									<view class="standard-number-l">0.381—0.475(++)</view>
									<view class="standard-number-r">
										<!-- <text decode="true">&lt;</text> -->
										0.381(+++)
									</view>
								</view>
							</view>
						</view>
						<view class="standrad-number-content">
							<view class="standard-title">解毒功能</view>
							<view class="standard-number">
								<view class="standard-number-h">
									<view class="standard-number-l">0.202—0.991(—)</view>
									<view class="standard-number-r">0.094—0.202(+)</view>
								</view>
								<view class="standard-number-h">
									<view class="standard-number-l">0.043—0.094(++)</view>
									<view class="standard-number-r">
										<!-- <text decode="true">&lt;</text> -->
										0.043(+++)
									</view>
								</view>
							</view>
						</view>

						<view class="standrad-number-content">
							<view class="standard-title">胆汁分泌功能</view>
							<view class="standard-number">
								<view class="standard-number-h">
									<view class="standard-number-l">0.432—0.826(—)</view>
									<view class="standard-number-r">0.358—0.432(+)</view>
								</view>
								<view class="standard-number-h">
									<view class="standard-number-l">0.132—0.358(++)</view>
									<view class="standard-number-r">
										<!-- <text decode="true">&lt;</text> -->
										0.132(+++)
									</view>
								</view>
							</view>
						</view>

						<view class="standrad-number-content">
							<view class="standard-title">肝内脂肪功能</view>
							<view class="standard-number">
								<view class="standard-number-h">
									<view class="standard-number-l">0.097—0.419(—)</view>
									<view class="standard-number-r">0.419—0.582(+)</view>
								</view>
								<view class="standard-number-h">
									<view class="standard-number-l">0.582—0.692(++)</view>
									<view class="standard-number-r">
										<!-- <text decode="true">&gt;</text> -->
										0.692(+++)
									</view>
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
import hl from '@/common/common.js';
export default {
	data() {
		return {
			tab_arr: ['肝功能检测报告', '胃肠功能检测报告', '胆功能检测报告'],
			tab_act: 0,
			userData: {}
		};
	},
	onLoad() {
		this.getData()
	},
	methods: {
		switch_tab(index) {
			this.tab_act = index;
		},
		getData(){
			let that = this
			that.bIsShowLoading = true;
			hl.get('member/getInfo', {}, true, function(res){
				that.bIsShowLoading = false;
				let resdata = res.data;
				if(resdata.code == '0') {
					that.userData = resdata.data;
					that.isLogin = true;
					uni.setStorage({
						key: 'userInfo',
						data: resdata.data
					});
					uni.removeStorageSync('select_userinfo');
				}else if(resdata.code == '-1'){
					that.isLogin = false;
					// 显示弹框登录
					// #ifdef MP-WEIXIN
						uni.navigateTo({
							url: "/pages/jewel/user/wxauth"
						})
					uni.removeStorageSync('wx_session_key');
					// #endif
				}
			})
		},
	}
};
</script>
<style>
.template {
	background-color: #f2f2f2;
	height: 100%;
	width: 100%;
}
.checkup-info {
	background-color: #fff;
}
.head-tab {
	border-bottom: 2rpx solid #f5f5f5;
	position: relative;
	z-index: 10;
	height: 92rpx;
	white-space: nowrap;
	display: flex;
	
}
.head-tab .tab-view {
	width: auto;
	padding: 0 26rpx;
	display: inline-block;
	height: 90rpx;
	text-align: center;
	line-height: 90rpx;
	font-size: 32rpx;
	color: #333333;
	position: relative;
	flex: 1;
}
.head-tab .tab-view-act {
	border-bottom: 2rpx solid #18a01f;
}
.checkup-container {
	width: 100%;
	height: 100%;
	overflow: hidden;
}
.body-container {
	width: 90%;
	margin: 0 auto;
	height: 100%;
	overflow: hidden;
}
.id-info {
	height: 106rpx;
	line-height: 106rpx;
	font-size: 26rpx;
}
.bold-font {
	font-size: 34rpx;
	font-weight: bold;
	display: inline-block;
}
.id-info-view {
	max-width: 50%;
	float: left;
	overflow: hidden;
	height: 106rpx;
}
.id-info-view-first {
	margin-right: 36rpx;
}
.body-info {
	height: 538rpx;
	width: 100%;
}
.body-info-l {
	float: left;
	width: 185rpx;
	height: 398rpx;
	margin-left: 52rpx;
	margin-top: 40rpx;
}
.body-info-l image {
	height: 100%;
	width: 100%;
}
.body-info-c {
	float: left;
	width: 20rpx;
	height: 398rpx;
	background: url('../../../static/images/jewel/health/body-height.png');
	background-repeat: repeat-y;
	background-size: 100%;
	margin-left: 45rpx;
	margin-top: 40rpx;
}
.body-height {
	position: relative;
	top: 181rpx;
	left: -13px;
}
.body-info-r {
	float: right;
	width: 210rpx;
	overflow: hidden;
}
.body-info-r .body-param-parent {
	height: 66rpx;
	margin-bottom: 32rpx;
}
.body-info-r .body-param {
	font-size: 34rpx;
	font-weight: bold;
}
.body-info-r .body-type {
	font-size: 28rpx;
	color: #666;
}
.body-info-head {
	height: 470rpx;
}
.body-info-foot image {
	height: 38rpx;
	width: 38rpx;
	float: left;
	margin-left: 50rpx;
	margin-right: 10rpx;
}
.body-weight {
	font-size: 28rpx;
}
.range-container {
	width: 666rpx;
	height: 112rpx;
	border: 1rpx solid #4ab846;
	border-radius: 12rpx;
	margin-bottom: 16rpx;
}

.range-type {
	background-color: #e2eada;
	font-size: 32rpx;
	height: 112rpx;
	line-height: 112rpx;
	text-align: center;
	width: 242rpx;
	float: left;
	border-right: 1rpx solid #4ab846;
	border-top-left-radius: 12rpx;
	border-bottom-left-radius: 12rpx;
}
.body-range-info {
	margin-bottom: 46rpx;
}
.range-text-container {
	width: 422rpx;
	float: left;
	height: 112rpx;
}
.range-text-container-child {
	width: 406rpx;
	margin: 0 auto;
	margin-top: 19rpx;
}
.range-text {
	font-size: 32rpx;
	width: 100%;
	text-align: center;
}
.range-text-container image {
	width: 406rpx;
	height: 18rpx;
}
.standard-container {
	margin-top: 20rpx;
	background-color: #fff;
	width: 100%;
	height: 100%;
	overflow: hidden;
}
.standard-content {
	width: 90%;
	height: 100%;
	margin: 0 auto;
	padding-top: 45rpx;
}
.reference-standard-text {
	font-size: 32rpx;
}
.standard-reminder-content {
	height: 85rpx;
	width: 100%;
	margin-bottom: 10rpx;
}
.reminder-row {
	height: 32rpx;
	width: 100%;
	margin-top: 18rpx;
}
.reminder-row-l {
	width: 50%;
	height: 100%;
	float: left;
}
.reminder-row-r {
	width: 50%;
	height: 100%;
	float: left;
}
.reminder-color {
	width: 88rpx;
	height: 16rpx;
	border: 1rpx solid #000;
	margin-right: 17rpx;
	float: left;
	margin-top: 14rpx;
}
.reminder-degree {
	font-size: 32rpx;
}
.reminder-orange {
	background-color: #fca86a;
}
.reminder-green {
	background-color: #56c852;
}
.reminder-yellow {
	background-color: #f9e655;
}
.reminder-red {
	background-color: #f45a58;
}
.standrad-number-container {
}
.standrad-number-content {
	height: 215rpx;
	border-bottom: 2rpx solid #efeeee;
	width: 100%;
}
.standard-title {
	color: #333;
	font-size: 32rpx;
	padding-top: 28rpx;
}
.standard-number {
	width: 95%;
	margin: 0 auto;
}
.standard-number-h {
	margin-top: 26rpx;
	overflow: hidden;
}
.standard-number-h view {
	width: 50%;
	float: left;
	color: #333;
	font-size: 28rpx;
}
</style>
